<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->
    <head>
        <!--<meta charset="utf-8"/>-->
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Hệ thống quản trị khách hàng</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta content="width=device-width, initial-scale=1" name="viewport"/>
        <meta content="" name="description"/>
        <meta content="" name="author"/>
        <!-- BEGIN GLOBAL MANDATORY STYLES -->
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
        <!-- END GLOBAL MANDATORY STYLES -->
        <!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
        <link href="<?php echo $url; ?>/assets/plugins/gritter/css/jquery.gritter.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css"/>
        <!-- END PAGE LEVEL PLUGIN STYLES -->
        <!-- BEGIN PAGE LEVEL STYLES -->
        <link href="<?php echo $url; ?>/assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/plugins/fancybox/source/jquery.fancybox.css" rel="stylesheet"/>
        <!-- BEGIN:File Upload Plugin CSS files-->
        <link href="<?php echo $url; ?>/assets/plugins/jquery-file-upload/blueimp-gallery/blueimp-gallery.min.css" rel="stylesheet"/>
        <link href="<?php echo $url; ?>/assets/plugins/jquery-file-upload/css/jquery.fileupload.css" rel="stylesheet"/>
        <link href="<?php echo $url; ?>/assets/plugins/jquery-file-upload/css/jquery.fileupload-ui.css" rel="stylesheet"/>
        <!-- END:File Upload Plugin CSS files-->
        <!-- BEGIN THEME STYLES -->
        <link href="<?php echo $url; ?>/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/style.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
        <link href="<?php echo $url; ?>/assets/css/print.css" rel="stylesheet" type="text/css" media="print"/>
        <link href="<?php echo $url; ?>/assets/css/pages/inbox.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/assets/css/custom.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/css/contact.css" rel="stylesheet" type="text/css"/>
        <link href="<?php echo $url; ?>/css/dashboard.css" rel="stylesheet" type="text/css"/>
        <!-- END THEME STYLES -->
        <link rel="shortcut icon" href="favicon.ico"/>
    </head>
    <!-- END HEAD -->
    <!-- BEGIN BODY -->
    <body class="page-header-fixed">
        <!-- BEGIN HEADER -->
        <div class="header navbar navbar-fixed-top">
            <!-- BEGIN TOP NAVIGATION BAR -->
            <div class="header-inner">
                <!-- BEGIN LOGO -->

                <!-- END LOGO -->
                <!-- BEGIN RESPONSIVE MENU TOGGLER -->
                <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <img src="<?php echo $url; ?>/assets/img/menu-toggler.png" alt=""/>
                </a>
                <!-- END RESPONSIVE MENU TOGGLER -->
                <!-- BEGIN TOP NAVIGATION MENU -->
                <ul class="nav navbar-nav pull-right">
                    <?php
                    require_once 'notification/notifications_lib.php';
                    $notifs = get_all_notification($_SESSION['id']);
                    ?>

                    <li id="header_notification_bar" class="dropdown" style="-moz-outline-radius: 0px; outline: 0px none; box-shadow: 0px 0px 13px rgba(102, 188, 230, 0);">
                        <a data-close-others="true" data-hover="dropdown" data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <i class="fa fa-warning"></i>
                            <span class="badge"><?php echo count($notifs) ?></span>
                        </a>
                        <ul class="dropdown-menu extended notification">
                            <li>
                                <p>
                                    Bạn có <?php echo count($notifs) ?> việc cần làm
                                </p>
                            </li>
                            <li>
                                <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: auto;"><ul style="height: auto; overflow: hidden; width: auto;" class="dropdown-menu-list scroller">
                                        <?php foreach($notifs as $notif){?>
                                        <li>
                                            <a href="<?php echo $url?>/support/view_support_detail.php?id=<?php echo $notif['id']?>">
                                                <span class="label label-sm label-icon label-success">
                                                    <i class="fa fa-plus"></i>
                                                </span>
                                                <?php echo $notif['support_name']?>
                                                <span class="time">
                                                    
                                                    <?php echo time_ago($notif['date_created']);?> trước
                                                </span>
                                            </a>
                                        </li>
                                        <?php }?>

                                    </ul><div class="slimScrollBar" style="background: none repeat scroll 0% 0% rgb(187, 187, 187); width: 7px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 160.256px;"></div><div class="slimScrollRail" style="width: 7px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; background: none repeat scroll 0% 0% rgb(234, 234, 234); opacity: 0.2; z-index: 90; right: 1px;"></div>
                                </div>
                            </li>
                            <li class="external">
                                <a href="<?php echo $url?>/support/supports.php">
                                    Xem tất cả <i class="m-icon-swapright"></i>
                                </a>
                            </li>
                        </ul>
                    </li>

                    <!-- BEGIN USER LOGIN DROPDOWN -->
                    <li class="dropdown user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                                <!--<img alt="" src="<?php echo $url; ?>/assets/img/avatar1_small.jpg"/>-->
                            <span class="username">
                                <?php echo $_SESSION['first_name'] . ' ' . $_SESSION['last_name'] ?>
                            </span>
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="<?php echo $url ?>/my_profile.php">
                                    <i class="fa fa-user"></i> Thông tin cá nhân
                                </a>
                            </li>
                            <?php
                            if (is_admin($_SESSION['id'])) {
                                ?>
                                <li>
                                    <a href="<?php echo $url ?>/user/users.php">
                                        <i class="fa fa-group"></i> Quản lý người dùng
                                    </a>
                                </li>
                                <?php
                            }
                            ?>
                            <li>
                                <a id="logout_link_id" href="#">
                                    <i class="fa fa-key"></i> Log Out
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
                <!-- END TOP NAVIGATION MENU -->
            </div>
            <!-- END TOP NAVIGATION BAR -->
        </div>
        <!-- END HEADER -->
        <div class="clearfix">
        </div>
